<admintpl file="header" />
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:U('Order/index')}">订单列表</a></li>
    </ul>

    <form class="well form-search" method="post" action="{:U('Order/index')}">
        下单时间段：
        <input type="text" name="start_time" class="js-datetime" value="{$start_time|default=''}" style="width: 120px;" autocomplete="off"> -
        <input type="text" class="js-datetime" name="end_time" value="{$end_time|default=''}" style="width: 120px;" autocomplete="off"> &nbsp;&nbsp;&nbsp;&nbsp;
        订单编号  <input  type="text" name="order_num" style="width: 160px;" <if condition="$_POST['order_num'] neq null"> value="{$_POST['order_num']}" </if> placeholder="请输入订单编号">
        <!--&nbsp;&nbsp;&nbsp;&nbsp;-->
        <input type="submit" class="btn btn-primary" value="筛选" />
        <a class="btn btn-danger" href="">清空</a>
    </form>
    <button class="btn btn-return" target-form="ids" onclick="javascript:exportexcel();">导出Excel</button>
    <table class="table table-hover table-bordered">
        <thead>
        <tr>
            <th>排序</th>
            <th>会员名称</th>
            <th>订单号</th>
            <th>日期</th>
            <th>订单金额</th>
            <th>支付方式</th>
            <th>下单时间</th>
            <th>订单状态</th>
            <th width="200">操作</th>
        </tr>
        </thead>
        <tbody>
        <foreach name="info" key="k" item="vo">
            <tr>
                <td>{$k+1}</td>
                <td>{$vo.user_name}</td>
                <td>{$vo.order_num}</td>
                <td>{$vo.create_time|date="Y-m-d H:i:s",###}</td>
                <td>￥{$vo.money}</td>
                <td><if condition="$vo['pay_type'] eq 1 ">微信<else/>支付宝</if></td>
                <td>{$vo.create_time|date="Y-m-d H:i:s",###}</td>
                <td>
                    <if condition="$vo['status'] eq 1">待付款
                        <elseif condition="$vo['status'] eq 2"/>待发货
                        <elseif condition="$vo['status'] eq 3"/>货在途
                        <elseif condition="$vo['status'] eq 4"/>订单完成
                        <elseif condition="$vo['status'] eq 5"/>取消
                        <elseif condition="$vo['status'] eq 6"/><span style="color:red;">退款申请</span>
                        <elseif condition="$vo['status'] eq 7"/><span style="color:red;">申请成功</span>
                        <elseif condition="$vo['status'] eq 8"/><span style="color:red;">申请退款失败</span>
                    </if>
                </td>
                <td>
                    <a  href="{:U('Order/detail',array('id'=>$vo['id']))}">详情</a> |
                    <if condition="$vo['status'] eq 1">
                        <a  href="{:U('Order/reState',array('id'=>$vo['id'],'status'=>2))}">付款</a> |
                        <a  href="{:U('Order/reState',array('id'=>$vo['id'],'status'=>-1))}">删除</a>
                        <elseif condition="$vo['status'] eq 2" />
                        <a  href="{:U('Order/reState',array('id'=>$vo['id'],'status'=>3))}">发货</a>
                        <elseif condition="$vo['status'] eq 3" />
                        <a  href="{:U('Order/reState',array('id'=>$vo['id'],'status'=>4))}">完成</a>
                        <elseif condition="$vo['status'] eq 4" />
                        <a  href="{:U('Order/reState',array('id'=>$vo['id'],'status'=>-1))}">删除</a>
                        <elseif condition="$vo['status'] eq 5" />
                        <a  href="{:U('Order/reState',array('id'=>$vo['id'],'status'=>-1))}">删除</a>
                    </if>
                </td>
            </tr>
        </foreach>
        </tbody>
    </table>
    <div class="pagination">{$page}</div>
</div>
<script type="text/javascript" src="__PUBLIC__/js/laydate/laydate.js"></script>
<script src="__PUBLIC__/js/common.js"></script>

<script >

    function finish(id) {
        if(confirm("确定拒绝要求吗并将订单改成完成状态吗？")){
            window.location.href = "__CONTROLLER__/status/id/"+id+"/status/5";
        }
    }

    function exportexcel(){

    }
</script>
</body>
</html>